var pageii = null;
var grid = null;
$(function() {

	grid = lyGrid({
		pagId : 'paging',
		l_column : [ {
			colkey : "machine_no",
			name : "机台号"
		}, {
			colkey : "mold_encode",
			name : "模具编号"
		}, {
			colkey : "finish_time",
			name : "够产时间"
		}, {
			colkey : "order_number",
			name : "够产数量"
		}, {
			colkey : "suite",
			name : "套数"
		}, {
			colkey : "mold_number",
			name : "模数"
		}, {
			colkey : "wite_mold_encode",
			name : "待装模具"
		}, {
			colkey : "remake",
			name : "备注"
		}],
		jsonUrl : rootPath + '/prepareOrder/prepareOrder_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {// 绑定查询按扭
		
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
	
});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	pageii = layer.open({
		title : "编辑备模指令表",
		type : 2,
		area : [ "800px", "100%" ],
		content : rootPath + '/prepareOrder/prepareOrder_edit.shtml?id=' + cbox
	});
}
